//
//  CustomTextField.m
//  月色:(我)
//
//  Created by 殷殷明静 on 16/9/8.
//  Copyright © 2016年 MJ.Y. All rights reserved.
//

#import "CustomTextField.h"

@interface CustomTextField ()<UITextFieldDelegate>

@end
@implementation CustomTextField
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // 签订协议
//        self.delegate = self;
        self.font = [UIFont systemFontOfSize:12];
        // 改变光标颜色
        [self setTintColor:[UIColor redColor]];
    }
    return self;
}
// 改变光标细度
- (CGRect)caretRectForPosition:(UITextPosition *)position {
    CGRect originaalRect = [super caretRectForPosition:position];
    originaalRect.size.width = 1;
    return originaalRect;
}
// 回收键盘1
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    return YES;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
